import React, { Component } from 'react'






// import { Flex, WhiteSpace, WingBlank } from 'antd-mobile';

import { SearchBar, Button, WhiteSpace, WingBlank ,Flex} from 'antd-mobile';



import { withRouter} from 'react-router-dom'

import './search.scss'
class Search extends Component {

    goToCityList=()=>{
        console.log(this.props)
        this.props.history.push('/citylist')
    }
    goToSearchCity=()=>{
        this.props.history.push('/searchcity')
    } 

    render() {
        return (

            <WingBlank size='md'  className='outerBox'>
                <Flex className='searchBox'  >

                
                 {/* onClick={()=>{this.props.history.push('/citylist')}} */}
                    <Flex.Item  className='searchName'    onClick={this.goToCityList} >
                 <span>{this.props.curCity}</span>
                 <i className='iconfont icon-arrow '></i>
                    </Flex.Item>
                    <Flex.Item className='InputBox'   onClick={this.goToSearchCity}>
                    <SearchBar placeholder="请输入想要搜索的内容" maxLength={8}   disabled/>
                    </Flex.Item>
                </Flex>
            </WingBlank>

        )
    }
}


export default  withRouter(Search)